home *** CD-ROM | disk | FTP | other *** search
- Path: chronicle.mti.sgi.com!news
- From: austern@isolde.mti.sgi.com (Matt Austern)
- Newsgroups: comp.lang.c++
- Subject: Re: C code in a C++ app
- Date: 05 Mar 1996 02:28:49 GMT
- Organization: SGI
- Message-ID: <AUSTERN.96Mar4182849@isolde.mti.sgi.com>
- References: <4h7t43$6as@frodo.smartlink.net> <Dnr5sw.KIn@doc.ntu.ac.uk>
- Reply-To: austern@mti.sgi.com
- NNTP-Posting-Host: isolde.mti.sgi.com
- In-reply-to: CHAMBERS Jason's message of Mon, 4 Mar 1996 16:58:08 GMT
-
- In article <Dnr5sw.KIn@doc.ntu.ac.uk> CHAMBERS Jason <pt3chaj> writes:
-
- > You should be able to compile C code using a C++ compiler. This stems from the
- > early days where C++ compilers essentially converted its input to C source, to
- > be passed to the C compiler. Maybe, the compilation errors you are getting are
- > due to non-portable code and nothing to do with the fact that you are compiling
- > using a C++ compiler.
-
- Not quite. C++ is almost compatible with C (As Bjarne Stroustrup
- points out, every program in K&R II is a legal C++ program), but only
- almost.
-
- As a trivial example, the program "int main() { int class; return 0; }"
- is legal C, but not legal C++.
- --
- Matt Austern
- SGI: MTI Compilers Group
- austern@isolde.mti.sgi.com
-